﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;


namespace ScriptZilla
{
    public partial class SaveByClose : Form
    {
        public SaveByClose()
        {
            InitializeComponent();
        }

        private void SaveByClose_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            Application.ExitThread();



        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Close();

        }

        private void button1_Click(object sender, EventArgs e)
        {
            var xForm1 = new Form1();

            saveFileDialog1.Filter = "Assembly Source File (*.asm)|*.asm|C# / CSharp Source File (*.cs)|*.cs|HTML-File (*.html)|*.html|JavaScript-File (*.js)|*.js|PostScript-File (*.ps)|*.ps|VBScript-File (*.vbs)|*.vbs|XML-File (*.xml)|*.xml|Ada Source File (*.ada)|*.ada|Windows-Batch-File (*.bat)|*.bat|CSS-File (*.css)|*.css|Ruby File (*.rb)|*.rb|Pascal Source File (*.pas)|*.pas|Perl Source File (*.pl)|*.pl|PHPScript-File (*.php)|*.php|Inno Setup Script (*.iss)|*.iss|Visual Basic Source File (*.vb)|*.vb|All Files (*.*)|*.*";
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                StreamWriter myWriterAs = new StreamWriter(saveFileDialog1.FileName);
                myWriterAs.Write(xForm1.scintilla1.Text);
                myWriterAs.Close();
                

            }
            Application.ExitThread();
        }
    }
}
